package com.comunity_cloud.rest;

public class RegistrationException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6365634201227777127L;

	public enum ConfictType {
		USER_NAME,
		EMAIL,
		CAPTCHA
	}
	
	private ConfictType conflictType;
	
	public RegistrationException( String conflictTypeStr) {
		if(conflictTypeStr.equals("email")) {
			conflictType = ConfictType.EMAIL;
		} else if(conflictTypeStr.equals("captcha")) {
			conflictType = ConfictType.CAPTCHA;
		} else {
			conflictType = ConfictType.USER_NAME;
		}
	}
	
	public ConfictType getConflictType() {
		return conflictType;
	}
}
